<?php
/**
* Administration module IndexController
*
* @author hcderaad
* @package EICms
* @subpackage Admin
*/

/**
* Administration module IndexController
*
* @author hcderaad
* @package EICms
* @subpackage Admin
*/
class Admin_IndexController extends EICms_Controller_Action {
	
	public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array()) {
		parent::__construct($request,$response,$invokeArgs);
		$this->view->title = $this->_('administration');
	}
	
	/**
	 * Default index generator.
	 *
	 */
	public function indexAction() {
		$this->view->adminbar = $this->_('administration');
		if($handle = opendir(dirname(__FILE__))) {
		    $this->view->content = '<p>' . $this->_('options') . '</p>' . PHP_EOL;
			$this->view->content .= '<ul>' . PHP_EOL;
		    while (false !== ($file = readdir($handle))) {
		    	if(filetype(dirname(__FILE__) . DIRECTORY_SEPARATOR . $file) == 'file') {
		    		$controller = strtolower(str_replace('Controller.php','',$file));
		    		if($controller != 'index') {
		    			$this->view->content .= '<li><a href="' . EICMS_Url::get($controller,'index',array(),'admin') . '">' . ucFirst($this->_($controller)) . '</a></li>' . PHP_EOL;
		    		}
		    	}
		    }
		    $this->view->content .= '</ul>' . PHP_EOL;
		}    
	}
	
	/**
	 * PHPInfo
	 *
	 */
	public function phpinfoAction() {
		$this->view->title = 'PHPInfo';
	}
}
?>